This flag is set if a user selects Cancel from a FILESELECT box.
@ENHANCED
---------
This flag is set if Windows is running in enhanced mode.
See also @REAL and @STANDARD
@EXISTS
-------
This flag is set if a window was found with the EXISTS function.
See also @NOEXISTS
@FILE
-----
This flag is set if a file was found with the FINDFILE function.
@FIND
-----
This flag is set if a string was found with the FINDSTRING function.
@ICON
-----
This flag is set if a window was found to be minimized with the ISICON function.
See also @MAX
@MAX
----
This flag is set if a window was found to be maximized with the ISMAX function.
See also @ICON
@NO
---
This flag is set if a user selects No from an ASK box.
See also @YES
@NOEXISTS
---------
This flag is set if a window was not found with the EXISTS function.
See also @EXISTS
@QUERY
------
This flag is set if a user entered text using the INPUT function.
@REAL
-----
This flag is set if Windows is running in real mode
See also @STANDARD and @ENHANCED
@SELECT
This flag is set if a user selects a file with the FILESELECT function.
@STANDARD
---------
This flag is set if Windows is running in standard mode.
See also @REAL and @ENHANCED
@VER30
------
This flag is set if the user is running Windows 3.0
See also @VER31
@VER31
------
This flag is set if the user is running Windows 3.1
See also @VER30
@YES
----
This flag is set if a user selects Yes from an ASK box
See also @NO
About()
-------
This function simply displays the cresits for Catch
Additem (item)
--------------
This function add the string specified by 'item' to the choice box. The
choice box can hold a maximum of 30 items. To select an item use the
CHOICE function.
Ask (caption, message)
----------------------
This function displays the string 'caption' in the caption bar of the ASK box,
and the string in 'message' in the center of the message box. It then prompts
the user to select either YES or NO.
Returns : YES if Yes was selected, NO if No was selected.
This function also sets the @YES or @NO flags, depending on which choice the
user makes.
EG : Ask ("Click", "Click either Yes or No")
If @YES Ok ("","You clicked Yes")
If @NO Ok ("","You clicked No")
Comparitors
-----------
Catch provides 6 comparitors which allow you to compare strings. They are:
1. == Equals
2. <> Is not equal to
3. >= Greater than or equal to
4. <= Less than or equal to
5. > Greater than
6. < Less than
Cd (pathname)
-------------
This functio allows you to change directory
ChDir (pathname)
----------------
See CD for a full description
Choice (caption, message)
-------------------------
This function allows you to choose one of the items added to the choice box
with the ADDITEM command. The text specified by 'caption' is displayed in the
window caption bar and the text specifed by 'message' is displayed in the
window.
Returns : The selected item if one is chosen, otherwise an empty string.
Close (partial window name)
---------------------------
This function terminates (closes) the program specified by 'partial window
name'.
For a full description of window names see the section "Windows names".
Del (filespec)
--------------
This function allows you to delete one or more files specified by 'filespec'.
To delete a file specify its filename. To delete multiple filenames you may
use wildcards.
Exists (partial window name)
----------------------------
This function checks to see if the program specified by 'partial window name'
is running.
It returns TRUE if the window exists, FALSE otherwise.
This function also sets the @EXISTS flag if the window exists and the @NOEXISTS flag if the window does not exist.
See the section "Window names" for details on how to specify Windows names.
EG : Exists ("Program Manager")
If @EXISTS ok ("" "Program manager is running")
Let running=Exists ("Clock")
if running=="FALSE" runmin ("clock.exe","")
FileSelect (filespec)
---------------------
This function allows you to give the user a choice of files to pick from.
Returns : Returns the name of selected file if one is selected, otherwise an
empty string.
EG : Let file=FileSelect("c:\windows\*.exe")
RunMin (file,"")
Let path="c:\temp\*.*"
FileSelect(path)
FindFile (filename)
-------------------
This function looks to see if the file specified by 'filename' exists.
'filename' may also include a directory specifier.
Returns : The full filename (path + filename) of the file, otherwise an empty
string.
This function alters the @FILE flag.
See the section "Search order" for details on where Catch looks for files.
Example
=======
This example checks to see if the Windows file README.TXT file exists in the directory C:\WINDOWS
Let name=FindFile ("c:\windows\readme.txt")
If @FILE Ok ("","Found README.TXT")
This examples searches the directories specified in the section "Search order" for the file WIN.COM
Let name=FindFile("win.com")
If @FILE Ok ("","Found WIN.COM")
FindString (filename, string)
-----------------------------
This function searches the file specified by 'filename' for the string
specified by 'string'.
Returns : The filename if successful, otherwise an empty string.
Flags
-----
Catch has a series of pre-defined flags which are set to either TRUE of FALSE,
depending oncertian actions.
These flags can be used used in IF statements to test to see if certain actions
have taken place.
GetCatchDir()
-------------
This function returns the directory name in which Catch is stored. The
returned string includes the drive specifier but does not end in a backslash
(\).
Example
=======
If Catch is on the C: drive in a directory called CATCH then this example will
display C:\CATCH
Let dir=GetCatchDir()
Ok ("Catch", dir)
GetEnv (varname)
----------------
This function returns the value of the environmental variable pointed to by
'varname'.
Returns : The value of the variable if it exists, otherwise an empty string
Example
=======
To get the PATH setting
Let path=GetEnv("path")
GetFreeMem()
------------
This function returns the amount of free memory available in K
GetIniData (appname, keyname, default, file)
--------------------------------------------
This function looks in a .INI file specified by 'file' for the value held by
'keyname' uder the section 'appname'.
If 'appname' or 'keyname' do not exists then you can specify a default value
in the 'defualt' string.
See the section ".INI" for more details on .INI files.
Returns : The required value if it exists, otherwise the value held in
'default'.
GetSysDir()
-----------
This function returns the Windows system directory. This directory contains
Windows fonts, libraries and drivers.
The retrieved pathname does not end with a backslash (\).
Example
=======
If the system directory is named WINDOWS\SYSTEM and is on drive C: then the
following example will display C:\WINDOWS\SYSTEM
Let dir=GetSysDir()
Ok ("",dir)
GetWinDir()
-----------
This function returns the directory in which Windows is installed. This is the
directory which typically holds the file WIN.COM.
The string returned does not end with a backslash (\) unless Windows is
installed in the root directory.
Example
=======
If Windows is installed in the directory WINDOWS on the C: drive then the
following example will display C:\WINDOWS
Let dir=GetWinDir()
Ok ("", dir)
Goto label
----------
This function advances execution to the line after 'label'.
EG : Goto load
.........
.........
.........
:load
Ok ("", "Skipped")
See the section on labels for details on how to specify labels
If
--
If flag dotrue | dofalse
If string1 <comparitor> string2 dotrue | dofalse
The If function allows you to carry out functions depending on whether of not
a flag or comparison evaluates to TRUE.
In the first case, 'flag' is a pre-defined flag which is set to either TRUE or
FALSE. A flag CANNOT be compared with another value.
Example
=======
This function displays a message if the version of Windows running is 3.0
If @VER30 Ok ("Windows", "This is Windows 3.0")
In the second case you can compare 2 strings. The comparison compares 'string1' to 'string2' and evaluates to either TRUE or FALSE.
To see a list of available comparitors see the section "Comparitors"
Example
=======
This function checks to make sure a correct password has been typed.
Let password=Input("Password", "Enter password")
If password<>"BLUE" ok ("Password", "Invalid password")
You can include an ELSE clause which will be carried out if the flag or string comparison evaluates to FALSE. An ELSE clause is included by seperating the 2 functions to be carried out with a vertical bar (|).
Example
=======
If @VER30 Ok ("Windows", "Windows 3.0") | Ok ("Windows", "Windows 3.1")
.INI
----
.INI files have the following layout :
[appname]
keyname=value
You can obtain information fron a .INI file by using GETINIDATA.
You can write data to, and delete data from a .INI file using WRITEINIDATA.
Input (caption, message)
------------------------
This function allow you to let the user enter data.
The text specified by 'caption' is displayed in the windows caption bar and the
string specified by message is displayed in the window.
Returns : This function returns the text entered by the user.
Example
=======
Let params=Input ("Load Notepad", "Enter file to load")
RunMin ("notepad.exe", params)
IsIcon (partial window name)
----------------------------
This function returns TRUE if the window specified by 'partial window name' is
an icon, FALSE otherwise.
IsIcon also sets the @ICON flag if the window is an icon.
See "Window names" for more info on how to specify a window name.
IsMax (partial window name)
---------------------------
This function checks to see if the window specified by 'partial window name'
is currently maximized.
Returns : TRUE if the window is maximized, FALSE otherwise.
This function also sets the @MAX flag if the window is maximized.
Join (string1, string2)
-----------------------
This function returns the result of appending 'string2' to 'string1'. Both
'string1' and 'string2' are unchanged.
Example
=======
Let s1="Hello"
Let s1=" there"
Let s3=Join (s1,s2)
s2 how contains "Hello there"
Let
---
Let varname=string
Let varname=function
Let assigns either the text in 'string' if a string is specified to 'varname',
of the return string from the function specified by 'function'.
If 'varname' already exists then the previous contents is owerwritten.
Example
=======
Let message="Do you want to load Clock"
Let file=FindString("readme.txt", "Procedures")
Max
---
Max (partial window name)
Maximize (partial window name)
This function maximizes a window to its full size.
For details on how to specify a window name see the section "Window names"
EG : Max ("Write")
Mem()
-----
This function displays a dialog box showing the following details :
1. Which processor is present.
2. The mode Windows is running in.
3. The amount of free memory available
Min
---
Min (partial window name)
Mimimize (partial window name)
This function allows you to minimize (iconise) a window by specifying its name.
The full name of the window does not need to be specified. For example, to
minimize Notepad when it is editing README.DOC you could use :
Min ("notepad")
or Min ("notepad - README")
Case is NOT important when specifying a window name.
See the section "Window names" for more info.
MkDir (dirname)
---------------
This function creates the direcory specified by 'dirname'.
An error occurs if the direcory already exists or if the pathname is invalid.
Example
=======
MkDir ("temp")
Move (partial window name, x1, y1, x2, y2)
------------------------------------------
This function moves and resizes the window specified by 'partial window name'
so that its top left corner is in position x1,y1 and it is x2 pixels wide
and y2 pixel high.
The coordinates x1, y1, x2, y2 must be specified as numbers. They CANNOT be
variables.
See the section "Window names" for details on how to specify window names.
EG : Move ("Program Manager",1,1,100,100)
Ok (caption, message)
---------------------
This function displays the string 'caption' in the caption bar of the ASK box,
and the string in 'message' in the center of the message box. It then waits for
the user to click on Ok
EG : Ok ("Notepad", "Click to load Notepad")
Rename (oldfile, newfile)
-------------------------
This function renames the program specified by 'oldfile' to the name specified
by 'newfile'.
If the old and new file names are in different directories then this function
copies the file in 'oldfile' to the directory specified in 'newfile' and
changes the name to that specified by 'newfile'.
EG : Rename ("readme.doc", "readme.txt")
To copy:
Rename ("readme.doc", "c:\temp\readme.doc")
Copies README.DOC to directory C:\TEMP and changes the filename to README.DOC
Restore
-------
Rst (partial window name)
Restore (partial window name)
This function restores a window to it previous size prior to a minimize or
maximize command.
See the section "Window names" for details on how to specify a window name.
EG : Rst ("notepad")
Let name="clock"
Rst (clock)
RmDir (dirname)
---------------
This function removes the directory specified by 'dirname'.
An error occurs if the directory is not empty or if the directory does not
exist.
Example
=======
RmDir ("temp")
Run (filename, parameters)
--------------------------
This function runs the program specified by 'filename' and passes to it any
parameters specified by 'parameters'.
EG : Run ("clock", "")
Run ("notepad", "readme.doc")
RunMax (filename, parameters)
-----------------------------
This function runs the program specified by 'filename' as a maximized window
and passes to it any parameters specified by 'parameters'.
EG : RunMax ("clock", "")
RunMax ("notepad", "readme.doc")
RunMin (filename, parameters)
-----------------------------
This function runs the program specified by 'filename' as an icon and passes
to it any parameters specified by 'parameters'.
EG : RunMin ("clock", "")
RunMin ("notepad", "readme.doc")
Search order
------------
Whenever you use a command which access a program of file, such as RUN and
FINDSTRING, and do not specify a path, Windows will search the following
directories in the given order:
1. The current directory
2. The Windows directory (obtainable by using GETWINDIR)
3. The Windows system directory (obtainable by using GETSYSDIR)
4. The directories listed in the PATH environmental variable
5. The list of directories mapped in a network
SendToClipboard (filename)
--------------------------
This function sends the text in the file 'filename' to the clipboard.
An error occurs if the file does not exist.
The file must not be larger than 64K (65536 bytes).
Example
=======
This function send the file README.TXT to the clipboard
SendToClipboard ("README.TXT")
Upper (var)
-----------
This function returns the result of converting all the alphabetic characters
in 'var' to uppercase. 'var' is left unchanged.
Example
=======
This example sets 'name' to HELLO
Let name=Upper ("hello")
This example set 'name' to YES
Let message="yes"
Let name=Upper(message)
UseLib (libname)
----------------
This function allows you to use third party functions which have been specially
designed for use with Catch.
The 'libname' must be the name of a .DLL (Dynamic Link Library).
Once you have accessed the .DLL using USELIB you canuse the functions in it as
you would any other Catch function.
Example
=======
If the library CATCH.DLL contains a function called Lower which converts a string to lower case then you can use it in the following way:
UseLib ("catch.dll")
Let name=Lower("FRED")
This will store 'fred' in the variable 'name'
For information on how to write Catch libraries see the file README.DOC
Variable names
--------------
Variable names in Catch can consist of alphabetic characters only. Numeric
and punctuation characters are not allowed. For example:
filename is valid
file1 is not
name is valid
_name is not
Window names
------------
Windows identifies a window by the text in its caption bar (The text between
the system menu box and the minimize icon).
For example, when you load up Notepad without a file the caption bar reads
"Notepad - (untitled)".
The problem with this is that if you change the file's name to say "README.DOC"
the caption bar changes to "Notepad - README.DOC"
In order to prevent you from having to allow for these changes in a window's
name Catch allows you to specify partial window names. This means that you
DO NOT have to specify the whole name.
For example, to maximize Notepad, no matter which file it is editing use the
command:
Max ("notepad")
WriteIniData (appname, key, value, file)
----------------------------------------
This function write the value specified by 'value to the .INI file specified by
'file'. The value is placed under the section 'appname' and is assigned to the
keyname 'keyname'.
To remove a keyname set 'value' to an empty string (""). To remove an entire
application section set 'appname' to an empty string.
See the section ".INI" for a full explanation on .INI files.
SECTION 2
=========
Thank you for trying Catch, I hope it has managed to fill all of your
requirements. If you have any hints or suggestions then write to me at :